//找单身狗
#include<stdio.h>
void func(int arr[],int sz){
  for (int i = 0; i < sz-1; i++)
  {
    for (int j = 0; j < sz-i-1; j++)
    {
      if(arr[j]>arr[j+1]){
        int temp = arr[j];
        arr[j] = arr[j+1];
        arr[j+1] = temp;
      }
    }
    
  }
}

void func1(int arr[],int sz){
  int ret = arr[0];
  int singler1 = 0;
  int singler2 = 0;
  for (int i = 1; i < sz; i++)
  {
    ret^=arr[i];
  }
  int pos = 0;
  for(int i = 0;i<32;i++){
    if(((ret>>i)&1)==1){
      pos = i;
      break;
    }
  }
  for (int i = 0; i < sz; i++)
  {
    if(((arr[i]>>pos)&1)==0){
      singler1^=arr[i];
    }
  }
  singler2 = ret^singler1;
  printf("%d %d",singler1,singler2);
}
int main(){
  int arr[] = {6,2,3,1,5,5,2,3,4,6};
  int sz = sizeof(arr)/sizeof(arr[0]);
  // func1(arr,sz);
  func(arr,sz);
  int i = 0;
  //1 1 2 4 4 5 5 6
  while(i<sz-1){
    if (arr[i]!=arr[i+1])
    {
      printf("%d ",arr[i]);
      i++;
    }else{
      i+=2;
    }
  }
  if(i==sz-1 && arr[i]!=arr[i-1]){
    printf("%d ",arr[i]);
  }
}